// Category 模型编辑
const mongoose = require('mongoose')

const schema = new mongoose.Schema({
  name: { type:String },
  address: { type:String },
  image: { type:String },
  categories: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'Category'}],
  hero: { type:mongoose.SchemaTypes.ObjectId,ref:'Hero' },
},  {
  // 时间戳，启用该配置后会自动添加 createdAt 、 updatedAt 两个字段，分别表示创建和更新时间
  timestamps: true
})

module.exports = mongoose.model('GreatVideo',schema)